//
//  FlagTableViewCell.m
//  PASystem
//
//  Created by 刘沿 on 16/9/22.
//  Copyright © 2016年 czd. All rights reserved.
//

#import "FlagTableViewCell.h"

@implementation FlagTableViewCell

+ (instancetype)WithFlagTableViewCell{

    return [[[NSBundle mainBundle] loadNibNamed:@"FlagTableViewCell" owner:nil options:nil] lastObject];
}

- (void)setModel:(FlagModel *)model{

    _model = model;
    
    self.USERNAME.text = model.USERNAME;
    self.TITLE.text = model.TITLE;
    
    //时间戳转时间
    NSString *string = model.CREATETIME;
    NSDateFormatter *fmt = [[NSDateFormatter alloc] init];
    fmt.dateFormat = @"MMM d, yyyy HH:mm:ss aa";
    fmt.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"];
    NSDate *date = [fmt dateFromString:string];
    NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd";
    NSString *selfYear = [fm stringFromDate:date];
    self.CREATETIME.text = selfYear;


}



@end
